
$.ajax({
	"url":"/web_name/",
	"dataType":"jsonp",
	"success":function(data){
		if(data.status){
			$("#title").text(data.content)
		}
	}
})

function signUp(){
	var data={};
	data.username=document.getElementById("username").value;
	data.chinese_name=document.getElementById("chinese_name").value;
	data.password=document.getElementById("password").value;
	var password2=document.getElementById("password2").value;
	data.type=document.getElementById("type").value;
	if(data.password !== password2){
		alert("两次密码不一致，请修改！")
		return false;
	}
	if(/^ *$/.test(username) || /^ *$/.test(password) || /^ *$/.test(data.chinese_name)){
		alert("不能为空！")
		return false;
	}
	data=JSON.stringify(data);
	jQuery.ajax({
		"url":"/create_user/",
		"data":{"data":data},
		"type":"POST",
		"error":errorAjax,
		"beforeSend":start_load_pic,
		"complete":stop_load_pic,
		"success":function(data){
			data=JSON.parse(data)
                	if (!data.status) {
                    	showErrorInfo(data.content);
                    	return false;
                	}
                     else {
			alert("创建成功！")
			window.location.href="login.html"
                     }
		}
	})
}
$(document).on("click","#signup",function(){
	signUp()
})
